﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KNXObjects
{
    public class HeatingModeObject : GenericObjectBase<UInt32>
    {
        #region ObjectBase Implementations

        public override string DataPointEISName
        {
            get { return string.Empty; }
        }

        public override string DataPointID
        {
            get { return "20.102"; }
        }

        public override string ToString()
        {
            switch (Value)
            {
                case 1:
                    return "comfort";
                case 2:
                    return "standby";
                case 3:
                    return "night";
                case 4:
                    return "frost";
                default:
                    return "frost";
            }
        }

        public override void SetValue(string value)
        {
            switch (value.ToLower())
            {
                case "comfort":
                    Value = 1;
                    break;
                case "standby":
                    Value = 2;
                    break;
                case "night":
                    Value = 3;
                    break;
                case "frost":
                    Value = 4;
                    break;
                default:
                    throw new ApplicationException("HeatingModeObjec: Bad value: " + value);
            }
        }        


        #endregion

        #region ctor

        public HeatingModeObject(string id, string address, string name, string flags)
            : base(id, address, name, flags)
        {
        }

        public HeatingModeObject(UInt32 value)
        {
            Value = value;
        }

        public HeatingModeObject(string value)
        {
            SetValue(value);
        }

        #endregion
    }
}
